package one;

abstract class peopele
{
    private String name;
    private int age;
//作用：当创建子类对象时，给属性进行赋值。
    public peopele(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public abstract void work();
    public void show()
    {
        System.out.println("wosji ");
    }
}
class student extends peopele{


    public student(String name, int age) {
        super(name, age);
    }

    @Override
    public void work() {
        System.out.println("assjdjsc");
    }
}
public class two {
    //private public
    //成员变量私有
    //方法公开
    //抽象类:抽象类不能实例化
    //抽象类中不一定有抽象方法，有抽象方法的类一定是抽象类
    //抽象类有构造方法
    //抽象类的子类要么是重写抽象类中的方法，要么是抽象子类
    public static void main(String[] args) {
       // peopele p=new peopele();不能创造对象
        student s=new student("chen",12);
        s.work();
        }
    }



